﻿<Window x:Class="Sample.PortfoliosWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:EcngTradingXaml="clr-namespace:StockSharp.Xaml;assembly=StockSharp.Xaml"
		Title="Портфели" Height="200" Width="470">
	<Window.Resources>
		<EcngTradingXaml:BackgroundConvertor x:Key="myConverter" />

		<Style x:Key="myItemStyle" TargetType="{x:Type ListViewItem}">
			<Setter Property="Background">
				<Setter.Value>
					<Binding RelativeSource="{RelativeSource Self}" Converter="{StaticResource myConverter}"/>
				</Setter.Value>
			</Setter>
		</Style>
	</Window.Resources>
	<Grid>
		<ListView x:Name="PortfolioDetails" Grid.Column="0" Grid.Row="0" ItemContainerStyle="{StaticResource myItemStyle}" ItemsSource="{Binding ElementName=portfolioWindow, Path=Positions}">
			<ListView.View>
				<GridView>
					<GridViewColumn Width="100" Header="Счет" DisplayMemberBinding="{Binding Path=Name}" />
					<GridViewColumn Width="120" Header="Начальный размер" DisplayMemberBinding="{Binding Path=BeginAmount}" />
					<GridViewColumn Width="120" Header="Текущией размер" DisplayMemberBinding="{Binding Path=CurrentAmount}" />
					<GridViewColumn Width="100" Header="Плечо" DisplayMemberBinding="{Binding Path=Leverage}" />
				</GridView>
			</ListView.View>
		</ListView>
	</Grid>
</Window>
